home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / (A)Z / (A)Z8.ADF / Nart / rotate.asm < prev   
Assembly Source File  |  1986-07-05  |  2KB  |  62 lines

  1. *\  :ts=8 bk=0                                            From: AMIGA.3955
  2. * ROTATE.ASM
  3. * The color rotater for the New Art program.
  4. * This was written in machine code for speed (Lattice has this odd habit
  5. * of pessimizing code).
  6. *
  7. * Calling convention:
  8. *  rotate ();
  9. *
  10. * Assembling (using MetaComCo Assembler):
  11. *  df1:c/assem rotate.asm -i df1:include -o rotate.o
  12. *
  13. * 8607.1
  14. */
  15.  
  16.                 include "exec/types.i"
  17.                 include "exec/libraries.i"
  18.                 include "graphics/view.i"
  19.  
  20. xlib            macro
  21.                 xref    _LVO\1
  22.                 endm
  23.  
  24. callsys         macro
  25.                 CALLLIB _LVO\1
  26.                 endm
  27.  
  28.                 xdef    _rotate
  29.  
  30.                 xref    _GfxBase
  31.                 xref    _vp
  32.  
  33.                 xlib    LoadRGB4
  34.  
  35.                 rorg    0
  36.  
  37.  
  38. _rotate         movem.l a2-a3/a6,-(sp)
  39.  
  40.                 movea.l _vp,a0
  41.                 movea.l a0,a1
  42.                 movea.l vp_ColorMap(a1),a1
  43.                 movea.l cm_ColorTable(a1),a1
  44.                 movea.l a1,a2
  45.                 adda.w  #1*2,a2         Point at the colors we want
  46.                 movea.l a2,a3
  47.                 addq.w  #2,a3
  48.                 moveq   #13,d0
  49.                 move.w  (a2),d1
  50. loop            move.w  (a3)+,(a2)+
  51.                 dbra    d0,loop
  52.                 move.w  d1,(a2)
  53.  
  54.                 movea.l _GfxBase,a6
  55.                 moveq   #32,d0
  56.                 callsys LoadRGB4
  57.  
  58.                 movem.l (sp)+,a2-a3/a6
  59.                 rts
  60.  
  61.                 end
  62.